package com.jmm.neditor.controller.neditor;

import com.jmm.neditor.model.AppInfo;
import com.jmm.neditor.model.BaseState;
import org.apache.commons.fileupload.FileItemIterator;
import org.apache.commons.fileupload.FileItemStream;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.UnsupportedEncodingException;

/**
 * ConfigController class
 *
 * @author 蒋时华
 * @date 2018-5-8
 */
@RestController
@RequestMapping("/neditor/config")
public class ConfigController {

    @Autowired
    private ActionEnter actionEnter;

    @RequestMapping("/route")
    public String config(HttpServletRequest request){
        try {
            return actionEnter.exec(request);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "error";
    }

}
